// Josh made this.

#include "Log.h"
#include "WindowManager.h"
#include "SFML\System.hpp"

sf::Texture *LogObject::logTex;
sf::Texture *logTexture = NULL;

void LogObject::Render()
{
	WindowMan::GetWindow()->draw(logSprite);
}

void LogObject::Update()
{
	logSprite.move(-backgroundSpeed, 0.f);
	logSprite.setScale(3.5f, 3.5f);

	Object::r.top = logSprite.getPosition().y;
	Object::r.left = logSprite.getPosition().x;
	Object::r.height = 49.0f;
	Object::r.width = 112.0f;

	if (logSprite.getPosition().x < -100) // Checking to see if the sprite has gone off screen.
	{
		Factory::DeleteObject(this); // Deleting the sprite once it moves off screen.
	}

	position = logSprite.getPosition();
}